function changeDisable(obj){
		var param = {
			id:$(obj).attr("dataId"),
			disable:$(obj).val()
		};
		API.sectionDnnDisableChangeDisable(param,function(res) {
			if (res.code == '0') {
			}else{
				location.reload();
				alert(res.desc);
			}
		});
}


function changeAscriptionSection(obj,id){
	var param = {
			"id":id,
			"ascriptionSection":$(obj).val()
	};
	API.sectionDnnDisableChangeAscriptionSection(param,function(res) {
		if (res.code == '0') {
		}else{
			location.reload();
			alert(res.desc);
		}
	});
	
}

function sectionExport(obj) {
	if(UTIL.checkButton(obj)) {
		window.location.href="/section/section_dnn_disable_export.do";
		UTIL.releaseButton(obj);
	}
}


function sectionImport(obj) {
	$("#file").click();
}
$("#file").change(function(){
	$("#Import").val("导入中");
	var url="/section/section_dnn_disable_import.do";
	importFile("#file",url,null);
});
/*
$("#file").change(fileChange);

function fileChange(){
	var file = $("#file").val();
	if(file) {
		var FileExt=file.replace(/.+\./,"");   //正则表达式获取后缀
		
		// 后缀只能是xlsx，其他不处理
		if(FileExt != 'txt') {
			alert("请上传txt后缀的txt文件");
			return false;
		}
		
		$.ajaxFileUpload({
			url: '/section/section_dnn_disable_import.do',
			secureuri: false,
			fileElementId: 'file',
			dataType: 'json',
			data: {},
			success: function(res, status) {
				$("#file").after($("#file").clone().val(""));
				$("#file").remove();
				$("#file").change(fileChange);
				if(res.code == '0') {
					if(res.desc){
						alert(res.desc);
					}
					window.location.href = "/section/section_dnn_disable_list.htm";
				} else {
					alert(res.desc);
					window.location.href = "/section/section_dnn_disable_list.htm";
				}
			},
			error: function (data, status, e) {
				$("#file").after($("#file").clone().val(""));
				$("#file").remove();
				$("#file").change(fileChange);
				alert("导入失败！");
			}
		});
	}
}
*/

function submitPage(obj){
	var ids = "";
	$("[name='dataid']").each(function() {
		ids += $(this).attr("dataid") + ",";
	});
	API.sectionDnnDisableSubmitPage({
		"ids" : ids
	}, function(res) {
		UTIL.releaseButton(obj);
		if (res.code == '0') {
			window.location.reload();
			UTIL.releaseButton(obj);
			return true;
		} else {
			alert(res.desc);
		}
	});
}


function deleteWarn(id){
	var param = {
			id:id
		};
	API.sectionDeleteWarn(param,function(res) {
		if (res.code == '0') {
			location.reload();
		}else{
			alert(res.desc);
		}
	});
}